package it.univpm.diiga.memorysim.actions;


import it.univpm.diiga.memorysim.views.Paginazione;


import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PartInitException;


public class ViewPaginazione implements IWorkbenchWindowActionDelegate {
	public static IWorkbenchWindow window;
	public static boolean codaprocessi=false;
	/**
	 * The constructor.
	 */
	public ViewPaginazione() {
	}


	public void run(IAction action) {
		if(window != null) {	
			try {
				 window.getActivePage().showView(Paginazione.ID, "Paginazione", IWorkbenchPage.VIEW_ACTIVATE);
			} catch (PartInitException e) {
				MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
			}
		}
	}


	public void selectionChanged(IAction action, ISelection selection) {
	}


	public void dispose() {
	}


	@SuppressWarnings("static-access")
	public void init(IWorkbenchWindow window) {
		this.window = window;
	}
}